package com.example.prometheus.config;

import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
import org.springframework.context.annotation.Configuration;

/**
 * 加入自定义标签
 */
@Configuration
public class CustomMeterRegistryCustomizer implements MeterRegistryCustomizer<MeterRegistry> {

    /**
     所有的上报数据都添加了该标签：{application="yt.prometheus",role="master",}
     */
    @Override
    public void customize(MeterRegistry registry) {
        registry.config().commonTags("application-belong", "telecom");
    }
}
